#ifndef _BUOLA_SCENE_TRANSFORM_CSOFTBODY_H_
#define _BUOLA_SCENE_TRANSFORM_CSOFTBODY_H_

#include <buola/scene.h>
#include <buola/scene/ctransform.h>
#include <buola/scene/cgeode.h>
#include <buola/mat.h>
#include <BulletSoftBody/btSoftBody.h>
#include <buola/scene/geodes/ccloth.h>

namespace buola { namespace scene {

typedef std::unique_ptr<btSoftBody> PBulletSoftBody;

class CSoftBody : public CTransform
{
public:
    CSoftBody(const PCloth &pCloth);
    ~CSoftBody();

    const PBulletSoftBody &GetBulletBody()    {   return mBody;   }
    PGeode Geode()                     {   return mCloth;  }

    void OnScene(const PScene &pScene);
    
private:
    void CalcLocalTransform() override;
    
private:
    PCloth mCloth;
    PBulletSoftBody mBody;
};

/*namespace scene*/ } /*namespace buola*/ }

#endif
